{% import "TopxiaWebBundle::macro.html.twig" as web_macro %}
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class=""> <!--<![endif]-->
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>
    {%- block title -%}
      {{ setting('site.name', 'EDUSOHO') }}
      {% if setting('site.slogan') %} - {{ setting('site.slogan') }} {% endif %}
      {% if not setting('copyright.owned') %} - Powered by EDUSOHO {% endif %}
    {%- endblock -%}
  </title>
  <meta name="keywords" content="{% block keywords %}{% endblock %}" />
  <meta name="description" content="{% block description %}{% endblock %}" />
  <meta content="{{ csrf_token('site') }}" name="csrf-token" />
  {{ setting('login_bind.verify_code', '')|raw }}
  {% if setting('site.favicon') %}
  <link href="{{ asset(setting('site.favicon')) }}" rel="shortcut icon" />
  {% endif %}
  {% block stylesheets %}
    <link href="{{ asset('assets/libs/gallery2/bootstrap/3.1.1/css/bootstrap.css') }}" rel="stylesheet" />
    <link rel="stylesheet" media="screen" href="{{ asset('assets/css/common.css') }}" />
    <link rel="stylesheet" media="screen" href="{{ asset('assets/css/bootstrap-extends.css') }}" />
    <link rel="stylesheet" media="screen" href="{{ asset('bundles/topxiaweb/css/web.css') }}" />
    <link rel="stylesheet" media="screen" href="{{ asset('themes/default-b/css/default-b.css') }}" />
    <link rel="stylesheet" media="screen" href="{{ asset('bundles/topxiaweb/css/member.css') }}" />
    <!--[if lt IE 8]>
      <link href="{{ asset('assets/css/oldie.css') }}" rel="stylesheet">
    <![endif]-->
  {% endblock %}
  <!--[if lt IE 9]>
    <script src="{{ asset('assets/libs/html5shiv.js') }}"></script>
  <![endif]-->

  <!--[if IE 8]>
    <script src="{{ asset('assets/libs/respond.min.js') }}"></script>
  <![endif]-->

  {% block head_scripts %}{% endblock %}

</head>
<body {% if bodyClass|default('') %}class="{{ bodyClass }}"{% endif %}>

{% block body %}

  <div class="navbar navbar-inverse site-navbar" id="site-navbar"  data-counter-url="{{ path('user_remind_counter') }}">
    <div class="container">
      <div class="container-gap">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          {% if setting('site.logo') %}
            <a class="navbar-brand-logo" href="{{ path('homepage') }}"><img src="{{ asset(setting('site.logo')) }}"></a>
          {% else %}
            <a class="navbar-brand" href="{{ path('homepage') }}">{{ setting('site.name', 'EDUSOHO') }}</a>
          {% endif %}
        </div>
        <div class="navbar-collapse collapse">
          {{ render(controller('TopxiaWebBundle:Default:topNavigation', {siteNav:siteNav|default(null)})) }}

          <ul class="nav navbar-nav navbar-right">
            {% if app.user %}
              <li><a href="{{ path('my') }}"> 我的课程 </a></li>
              {% if setting('mobile.enabled') %}
                <li><a href="{{ path('mobile') }}" class="mobile-badge-container">
                  <span class="glyphicon glyphicon-phone"></span>
                  <span class="badge">v2</span>
                </a></li>
              {% endif %}
              <li><a href="{{ path('search') }}"><span class="glyphicon glyphicon-search"></span></a></li>
              <li><a href="{{ path('notification') }}" class="badge-container notification-badge-container">
                <span class="glyphicon glyphicon-bullhorn hidden-lt-ie8"></span>
                <span class="visible-lt-ie8">通知</span>
                {% if app.user.newNotificationNum > 0 %}<span class="badge">{{ app.user.newNotificationNum }}</span>{% endif %}</a></li>
              <li>
                <a href="{{ path('message') }}" class="badge-container message-badge-container">
                <span class="glyphicon glyphicon-envelope hidden-lt-ie8"></span>
                <span class="visible-lt-ie8">私信</span>
                {% if app.user.newMessageNum > 0 %}<span class="badge">{{ app.user.newMessageNum }}</span>{% endif %}
                </a>
              </li>
              <li class="visible-lt-ie8"><a href="{{ path('settings') }}">{{ app.user.nickname }}</a></li>
              <li class="dropdown hidden-lt-ie8">
                <a href="javascript:;" class="dropdown-toggle"  data-toggle="dropdown">{{ app.user.nickname }} <b class="caret"></b></a>
                <ul class="dropdown-menu">
                  <li><a href="{{ path('user_show', {id:app.user.id}) }}"><i class="glyphicon glyphicon-home"></i> 我的主页</a></li>
                  <li><a href="{{ path('settings') }}"><i class="glyphicon glyphicon-cog"></i> 帐号设置</a></li>
                  <li class="divider"></li>
                  {% if is_granted('ROLE_BACKEND') %}
                    <li><a href="{{ path('admin') }}"><i class="glyphicon glyphicon-dashboard"></i> 管理后台</a></li>
                    <li class="divider"></li>
                  {% endif %}
                  <li><a href="{{ path('logout') }}"><i class="glyphicon glyphicon-off"></i> 退出</a></li>
                </ul>
              </li>
            {% else %}
              {% if setting('mobile.enabled') %}
                <li><a href="{{ path('mobile') }}"><span class="glyphicon glyphicon-phone"></span> 手机版</a></li>
              {% endif %}
              <li><a href="{{ path('search') }}"><span class="glyphicon glyphicon-search"></span> 搜索</a></li>
              <li><a href="{{ path('login', {goto:_target_path|default(app.request.server.get('REQUEST_URI'))}) }}">登录</a></li>
              <li><a href="{{ path('register', {goto:_target_path|default(app.request.server.get('REQUEST_URI'))}) }}">注册</a></li>
            {% endif %}
          </ul>
        </div><!--/.navbar-collapse -->
      </div>
    </div>
  </div>

  <div id="content-container" class="container">
    {% if app.user and app.user.setup == 0 and (hideSetupHint is not defined or hideSetupHint != true) %}
      <div class="alert alert-warning">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
        为了帐号的安全，以及更好的使用体验，请设置您的Email地址。
        <a href="{{ path('settings_setup') }}">现在就去设置</a>
      </div>
    {% endif %}
    {% block content %}{% endblock %}
  </div><!-- /container -->

  <div class="site-footer container clearfix">

    {{ render(controller('TopxiaWebBundle:Default:footNavigation')) }}

    <div class="text-gray" data-role="default-foot-bar">
      {% include "TopxiaWebBundle::powered-by.html.twig" %}
      {{ setting('site.analytics')|raw }}
      <div class="pull-right">{% if setting('site.copyright') %}课程内容版权均归<a href="/">{{ setting('site.copyright') }}</a>所有{% endif %}&nbsp;{% if setting('site.icp') %}<a href="http://www.miibeian.gov.cn/" target="_blank">{{ setting('site.icp') }}</a>{% endif %}</div>

      <div class="pull-right mhs"><a href="{{ path('course_archive') }}">课程存档</a></div>
    </div>
  </div>

  {% block bottom %}{% endblock %}

  <div id="login-modal" class="modal" data-url="{{ path('login_ajax') }}"></div>
  <div id="modal" class="modal"></div>
{% endblock %}

{% include 'TopxiaWebBundle::script_boot.html.twig' with {script_main: asset('bundles/topxiaweb/js/app.js')} %}


</body>
</html>